// SUCK: Set the model, movetype, size, think function, and touch function.
// Assumes the rune is self.
void() InitRune =
{
local float runenum;
runenum=self.rune_num;
self.flags = FL_ITEM;
self.solid = SOLID_TRIGGER;
self.movetype = MOVETYPE_TOSS;
self.classname = "rune";
self.rune_init=SUB_Null;
if (runenum == ITEM_RUNE_RESIST)
{
setmodel (self, "progs/end1.mdl");
self.rune_msg="┼ß≥⌠Φ ═ßτΘπ!\n\n╥σ≤Θ≤⌠ßεπσ";
self.rune_init_time= -1;
}
else if (runenum == ITEM_RUNE_DBLDMG)
{
setmodel (self, "progs/end2.mdl");
self.rune_msg="┬∞ßπδ ═ßτΘπ!\n\n╙⌠≥σετ⌠Φ";
self.rune_init_time= -1;
}
else if (runenum == ITEM_RUNE_HASTE)
{
setmodel (self, "progs/end3.mdl");
self.rune_msg="╚σ∞∞ ═ßτΘπ!\n\n╚ß≤⌠σ";
self.rune_init_time= -1;
}
else if (runenum == ITEM_RUNE_REGEN)
{
setmodel (self, "progs/end4.mdl");
self.rune_msg="┼∞Σσ≥ ═ßτΘπ!\n\n╥στσεσ≥ß⌠Θ∩ε";
self.rune_init_time=0;
}
else if (runenum == ITEM_RUNE_CASTLE)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel (self, "progs/castle.mdl");
else
setmodel (self, "progs/b_g_key.mdl");
self.rune_msg="The Castle Rune!\nYour guarding powers have increased.\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_SIEGE)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel (self, "progs/siege.mdl");
else
setmodel (self, "progs/b_s_key.mdl");
self.rune_msg="The Siege Rune!\nYour offensive powers have increased.\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_PRIEST)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel (self, "progs/priest.mdl");
else
setmodel (self, "progs/m_s_key.mdl");
self.rune_msg="Priest Rune!\n";
self.rune_init_time=0;
}
if (runenum == ITEM_RUNE_ARTHUR)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel(self, "progs/kingart.mdl");
else
setmodel (self, "progs/end1.mdl");
self.rune_msg="Rune of King Arthur!\n";
self.rune_init_time=0;
}
else if (runenum == ITEM_RUNE_WEREWOLF)
{
self.skin = 5;
setmodel (self, "progs/end3.mdl");
self.rune_msg="Werewolf Rune!\n";
self.rune_init=rinit_werewolf;
self.rune_init_time=5;
}
else if (runenum == ITEM_RUNE_WITCH)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel(self, "progs/witch.mdl");
else
setmodel (self, "progs/end4.mdl");
self.rune_msg="Witch Rune!\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_VAMPIRE)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel (self, "progs/vamp.mdl");
else
setmodel (self, "progs/m_g_key.mdl");
self.rune_msg="You are stricken by the vampire bite!\n";
self.rune_init_time=1;
self.rune_init=rinit_vampire;
}
else if (runenum == ITEM_RUNE_VIKING)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel (self, "progs/viking.mdl");
else
setmodel (self, "progs/b_g_key.mdl");
self.rune_msg="The Viking Rune!\n";
self.rune_init_time=0;
}
else if (runenum == ITEM_RUNE_HERMES)
{
self.skin = 3;
setmodel (self, "progs/end1.mdl");
self.rune_msg="Rune of Hermes!\n";
self.rune_init_time=-1;
self.rune_init=rinit_hermes;
}
else if (runenum == ITEM_RUNE_VULCAN)
{
self.skin = 3;
setmodel (self, "progs/end2.mdl");
self.rune_msg="Rune of Vulcan!\n\nSelect a weapon you do not have\nto forge it.\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_MARS)
{
self.skin = 3;
setmodel (self, "progs/end3.mdl");
self.rune_msg="Rune of Mars!\n\nYou are powerful, but easy to damage.\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_POSEIDON)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel (self, "progs/poseidon.mdl");
else
setmodel (self, "progs/m_s_key.mdl");
self.rune_msg="Rune of Poseidon!\n";
self.rune_init_time=0.5;
self.rune_init=rinit_poseidon;
}
else if (runenum == ITEM_RUNE_SHYLOCK)
{
setmodel (self, "progs/w_s_key.mdl");
self.rune_msg="Rune of Shylock!\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_THOR)
{
if (teamplay&TEAM_CUSTOM_RUNES)
setmodel (self, "progs/thor.mdl");
else
setmodel (self, "progs/w_g_key.mdl");
self.rune_msg="Rune of Thor!\n";
self.rune_init=rinit_thor;
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_LOKI)
{
self.skin = 4;
setmodel (self, "progs/end4.mdl");
self.rune_msg="Rune of Loki!\n";
self.rune_init_time=-1;
self.rune_init=rinit_loki;
}
else if (runenum == ITEM_RUNE_BALDER)
{
self.skin = 4;
setmodel (self, "progs/end2.mdl");
self.rune_msg="Rune of Balder!\n";
self.rune_init_time= -1;
}
else if (runenum == ITEM_RUNE_YTR)
{
self.skin = 4;
setmodel(self, "progs/end3.mdl");
self.rune_msg = "Rune of Ytr!\n";
self.rune_init_time = -1;
}
else if (runenum == ITEM_RUNE_NINJA)
{
self.skin = 2;
setmodel (self, "progs/end1.mdl");
self.rune_msg="Ninja Rune!\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_SAMURAI)
{
self.skin = 2;
setmodel (self, "progs/end2.mdl");
self.rune_msg="Samurai Rune!\n";
self.rune_init=rinit_samauri;
self.rune_init_time= 0;
}
else if (runenum == ITEM_RUNE_MONK)
{
self.skin = 2;
setmodel(self, "progs/end3.mdl");
self.rune_msg ="Zen Monk Rune!\n\nThe rock is unmoved by the storm.\n";
self.rune_init_time = -1;
}
else if (runenum == ITEM_RUNE_SHOGUN)
{
self.skin = 2;
setmodel(self, "progs/end4.mdl");
self.rune_msg = "Shogun Rune!\n";
self.rune_init_time = 0;
}
else if (runenum == ITEM_RUNE_WENDIGO)
{
setmodel (self, "progs/m_s_key.mdl");
self.rune_msg="Rune of Wendigo!\n";
self.rune_init_time=0;
}
else if (runenum == ITEM_RUNE_WOLVERINE)
{
setmodel (self, "progs/end4.mdl");
self.rune_msg="Rune of Wolverine!\n";
self.rune_init_time=0;
}
else if (runenum == ITEM_RUNE_GOLOM)
{
setmodel (self, "progs/end4.mdl");
self.rune_msg="Rune of Golom!\n";
self.rune_init_time=0;
}
else if (runenum == ITEM_RUNE_SARGON)
{
setmodel (self, "progs/end4.mdl");
self.rune_msg="Rune of Sargon!\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_IFRITE)
{
self.skin = 3;
setmodel (self, "progs/w_s_key.mdl");
self.rune_msg="Ifrite Rune!\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_KIZI)
{
setmodel (self, "progs/end3.mdl");
self.rune_msg="Rune of Kizi!\n";
self.rune_init_time=-1;
}
else if (runenum == ITEM_RUNE_ALIBABA)
{
setmodel(self, "progs/w_g_key.mdl");
self.rune_msg="Rune of Ali Baba!\n";
self.rune_init_time = -1;
self.rune_init = rinit_alibaba;
}
else if (runenum == ITEM_RUNE_WIND)
{
setmodel(self, "progs/end1.mdl");
self.rune_msg = "Rune of Wind Arrows!\n";
self.rune_init_time = -1;
}
else if (runenum == ITEM_RUNE_SANDSTORM)
{
setmodel(self, "progs/w_g_key.mdl");
self.rune_msg = "SandStorm Rune\n";
self.rune_init_time = 0;
}
else if (runenum == ITEM_RUNE_ANKH)
{
self.skin = 3;
setmodel(self, "progs/end1.mdl");
self.rune_msg = "Ankh Rune!\n";
self.rune_init_time = 1;
}
else
{
remove(self);
return;
}
setsize (self, '-16 -16 0', '16 16 56');
self.touch = RuneTouch;
self.nextthink = time + 120;
self.think = RuneRespawn;
};
// SUCK: Tell the player which rune they have just picked up.
// Assumes the player is 'other'. This function also sets up
// any player values that need to be initialized on rune pickup.
void() RuneGrab =
{
// Rune announcements go to the center of the screen
other.msg_center=1;
// Tell them what rune they've just gotten
clientmsg(other, self.rune_msg);
// Set the next rune execution time. -1 means never execute.
if (self.rune_init_time == -1)
other.rune_time = -1;
else
other.rune_time=time + self.rune_init_time;
// Do any initialization that might be necessary
if (self.rune_init != SUB_Null)
self.rune_init();
};
// SUCK: Print a description of whatever rune the player is holding.
// Assumes the player is self.
void() SetRuneInfoMsg =
{
if (self.rune_num == 0)
clientmsg(self,
"You do not have a rune.\n");
else if (self.rune_num == ITEM_RUNE_RESIST)
clientmsg(self,
"Rune of Earth Magic\nOriginal Rune Set\n\nThis rune makes you take half damage.\n");
else if (self.rune_num == ITEM_RUNE_DBLDMG)
clientmsg(self,
"Rune of Black Magic\nOriginal Rune Set\n\nThis rune makes you do double damage.\n");
else if (self.rune_num == ITEM_RUNE_HASTE)
clientmsg(self,
"Rune of Hell Magic\nOriginal Rune Set\n\nThis rune allows you to fire at double\nspeed.\n");
else if (self.rune_num == ITEM_RUNE_REGEN)
clientmsg(self,
"Rune of Elder Magic\nOriginal Rune Set\n\nThis rune regenerates your health and\narmor.\n");
else if (self.rune_num == ITEM_RUNE_PRIEST)
clientmsg(self, "Priest Rune\nMedieval Rune Set\n\nWith the priest rune, your health slowly\nregenerates. Additionally, your\nprojectiles are accompanied\nby bubbles of holy water that heal your\nteammates\nand hurt your enemies.\nTo\naccess a flask of pure holy water\nselect the shotgun twice.\nFinally, you do tremendous damage to the vampire.\n");
else if (self.rune_num == ITEM_RUNE_CASTLE)
clientmsg(self, "Castle Rune\nMedieval Rune Set\n\nYour shots do double damage and you take\nhalf damage in the vicinity of your flag.\n");
else if (self.rune_num == ITEM_RUNE_SIEGE)
clientmsg(self, "Siege Rune\nMedieval Rune Set\n\nYour shots do double damage and you take\nhalf damage in the vicinity of the enemy\nflag\nor while you carry the enemy flag.\n");
else if (self.rune_num == ITEM_RUNE_ARTHUR)
clientmsg(self, "King Arthur\nMedieval Rune Set\n\nYour health and ammo slowly regenerate,\nyou\ntake half damage from enemy fire,\nand the health and ammo of nearby\nteammates also regenerate.\n");
else if (self.rune_num == ITEM_RUNE_VAMPIRE)
clientmsg(self, "Vampire Rune\nDark Ages Rune Set\n\nYour health slowly drains away, but you\ngain one third of the damage you do to\nothers. Additionally, you have slightly\nincreased strength and resistance.\nYour axe does tremendous damage.\n");
else if (self.rune_num == ITEM_RUNE_WEREWOLF)
clientmsg(self, "Werewolf Rune\nDark Ages Rune Set\n\nYou do damage to enemies simply by\ntouching them. You can jump very far\nand high, and you always\nhave 100 yellow armor.\n");
else if (self.rune_num == ITEM_RUNE_WITCH)
clientmsg(self, "Witch Rune\nDark Ages Rune Set\n\nWhenever you damage someone\nthere is a chance that you will curse\nhim, making him jump and fire\nuncontrollably.\n");
else if (self.rune_num == ITEM_RUNE_VIKING)
clientmsg(self, "Viking Rune\n\nDark Ages Rune Set\n\nYou do tremendous damage to the priest,\nand can pick up objects just by being\nnear them.\n\nYou cannot pick up a weapon\nmore than once.\n");
else if (self.rune_num == ITEM_RUNE_KIZI)
clientmsg(self, "Kizi Rune\nArabian Set\n\nSwing the axe to teleport to your base.\nThe lower your health, the more damage\nyou do.\n");
else if (self.rune_num == ITEM_RUNE_IFRITE)
clientmsg(self, "Ifrite Rune\nArabian Set\n\nThe Ifrite were the fire spirits of\nArabian lore, so your shots are trailed\nby fire and you regenerate in lava.\nPlus, you have a larger blast radius and\nare immune to your own splash damage.\n");
else if (self.rune_num == ITEM_RUNE_THOR)
clientmsg(self, "Rune of Thor\nNorse Set\n\nYour thunderbolt will never run out of\nammo. You can also boil the\nwater with\nyour lightning.\n");
else if (self.rune_num == ITEM_RUNE_YTR)
clientmsg(self, "Rune of Ytr\nNorse Set\n\nYou have tremendous speed and agility,\nfor you ride atop an eight-legged horse.\nThe trick is to learn to control it.\n\nAdditionally, you decrease the strength\nof nearby enemies.\n");
else if (self.rune_num == ITEM_RUNE_NINJA)
clientmsg(self, "Ninja Rune\nJapanese Set\n\nFire your shotgun to teleport. You move\nand fire silently. When you die, you\nleave no corpse or ammo.\n");
else if (self.rune_num == ITEM_RUNE_SAMURAI)
clientmsg(self, "Samurai Rune\nJapanese Set\n\n2x damage with axe and\nnailguns. 1/4x damage with shotguns and\nrockets.\nRed armor regens to 200 every 25 seconds.\nAxe has 10x the reach normal.\n");
else if (self.rune_num == ITEM_RUNE_MONK)
clientmsg(self, "Zen Monk Rune\nJapansese Set\n\nIf you do not fire nor move, you will\ntake no damage from weapons. You take\nno splash damage.\n\nYou cannot pick up a weapon\nmore than once.\n");
clientmsg(self, "Rune of Balder\nNorse Set\n\nYou slow down your enemy's\nrate of fire by shooting them.\n");
else if (self.rune_num == ITEM_RUNE_LOKI)
clientmsg(self, "Rune of Loki\nNorse Set\n\nWhen you are stationary, you are invisible. See the\nweb page for more details.\nhttp://linux.mit.edu/quake\n");
else if (self.rune_num == ITEM_RUNE_ALIBABA)
clientmsg(self, "Rune of AliBaba\nArabian Set\n\nWhen you touch an opponent you remove\nalmost all their ammo and get some of it.\nYou sometimes teleport to safety\nwhen in lava.\n");
else if (self.rune_num == ITEM_RUNE_WENDIGO)
clientmsg(self, "Rune of Wendigo\nMisc. Set\n\nYour health slowly decreases. When you\nshoot someone, their velocity and\ndirection lock for a short period of\ntime.\n");
else if (self.rune_num == ITEM_RUNE_GOLOM)
clientmsg(self, "Rune of Golom\nMisc. Set\n\nYou take one quarter damage but cannot\nuse explosive weapons or\nthe whoremaker.\n");
else if (self.rune_num == ITEM_RUNE_SARGON)
clientmsg(self, "Rune of Sargon\nMisc. Set\n\nYou pick up twice the ammo and health\nthat you normally would. You do double\ndamage to the flagcarrier, and to Golom\n");
else if (self.rune_num == ITEM_RUNE_SANDSTORM)
clientmsg(self, "Sandstorm Rune\nArabian Set\n\nRandom damage and decreased visibility\nto nearby opponents.\n");
else if (self.rune_num == ITEM_RUNE_WIND)
clientmsg(self, "Rune of Wind Arrows\nMisc. Set\n\nYour projectiles travel at twice\nthe normal speed.\n");
else if (self.rune_num == ITEM_RUNE_MARS)
clientmsg(self, "Rune of Mars\nHellenic Set\n\nYou are powerful, but\neasy to damage.\n");
else if (self.rune_num == ITEM_RUNE_POSEIDON)
clientmsg(self, "Rune of Poseidon\nHellenic Set\n\nYour thunderbolt is now a powerful trident,\nif you allow it to charge up to 100 cells.\nPlus, you cause earthquakes,\nshaking nearby enemies.\n\nYou also regenerate in water.\n");
else if (self.rune_num == ITEM_RUNE_HERMES)
clientmsg(self, "Rune of Hermes\nHellenic Set\n\nYou can fly.\n");
else if (self.rune_num == ITEM_RUNE_VULCAN)
clientmsg(self, "Rune of Vulcan\nHellenic Set\n\nYou can forge weapons and ammo\nby selecting the number of corresponding weapon.\nYou also take one half damage to your\nhealth, but move a bit slower.\n");
else
clientmsg(self, "Sorry, no rune description for\nyour rune yet.\n");
};
void(entity e) RegenerateAmmo =
{
if ((e.ammo_shells>0) && (e.ammo_shells<91))
e.ammo_shells=e.ammo_shells+10;
if ((e.ammo_nails > 0) && (e.ammo_nails<191))
e.ammo_nails=e.ammo_nails+10;
if ((e.ammo_rockets>0) && (e.ammo_rockets<100) && (e.regen_rocket==1))
e.ammo_rockets=e.ammo_rockets+1;
if (e.regen_rocket == 0)
e.regen_rocket = 1;
else
e.regen_rocket = 0;
if (e.weapon == IT_SHOTGUN)
e.currentammo=e.ammo_shells;
if ((e.weapon == IT_NAILGUN) || (e.weapon == IT_SUPER_NAILGUN))